package vklib.emulator
{
    import flash.display.*;

    public class VkConfig extends Object
    {
        private static var _config:Object = {
			swf_url: '', debug: false, scale: 1, stageScale: 1,
			api_url: 'http://api.vkontakte.ru/api.php', api_result: '', auth_key: '',
			test_mode: -1, api_id: -1, user_id: -1, group_id: -1, viewer_id: -1,
			is_app_user: -1, viewer_type: -1, language: -1, api_settings: -1
		};

        public function VkConfig()
        {
            return;
        }// end function

        public static function getConfig() : Object
        {
            return _config;
        }// end function

        public static function loadConfig(param1:LoaderInfo) : Object
        {
            var external:VkExternal;
            var value:String;
            var parameters:Object;
            var key:String;
            var loaderInfo:* = param1;
            external = VkExternal.getInstance();
            try
            {
                parameters = loaderInfo.parameters;
                var _loc_3:int = 0;
                var _loc_4:* = parameters;
                while (_loc_4 in _loc_3)
                {
                    
                    key = _loc_4[_loc_3];
                    value = String(parameters[key]);
                    _config[key] = unescape(value);
                }
            }
            catch (error:Error)
            {
                external.debug("ERROR on loadConfig: " + error.message);
            }
            return _config;
        }// end function

    }
}
